package com.jasonmar.ignite.lang

import org.apache.ignite.lang.{IgniteCallable, IgniteClosure, IgnitePredicate, IgniteRunnable}

/**
  * Created by Administrator on 2017/11/14.
  */
trait FnConverterTmp {
  implicit def toIgniteRunnable(act: => Unit) = new IgniteRunnable {
    def run = act
  }

  implicit def toIgniteCallable[R](act: => R) = new IgniteCallable[R] {
    def call = act
  }

  implicit def toIgniteClosure[F, T](act: F => T) = new IgniteClosure[F, T] {

    def apply(f: F) = act(f)
  }

  implicit def toIgnitePredicate[F](act:F=>Boolean)=new IgnitePredicate[F]{
    override def apply(e: F): Boolean = act(e)
  }
}
